<?php

namespace App\Services;

use App\Utils\AES;

class AesService extends BaseService {
    /**
    *加密
     */
    public static function encrypt($str){
        $config = self::getConfig($tab = 1);
        $encrypt = AES::encrypt($str, $config['app_key'], substr($config['app_secret'], 0, 16));
        return $encrypt;
    }

    /**
    *解密
     */
    public static function decrypt($str){
        $config = self::getConfig($tab = 1);
        print_r($config);die;
        $decrypt = AES::decrypt($str, $config['app_key'], substr($config['app_secret'], 0, 16));
        return $decrypt;
    }
}
